<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddRejectRemarkToDriversTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasColumns('drivers', ['reject_remark'])) {
            Schema::table('drivers', function (Blueprint $table) {
                $table->string('reject_remark')->nullable()->comment('驳回备注');
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if (Schema::hasColumns('drivers', ['reject_remark',])) {
            Schema::table('drivers', function (Blueprint $table) {
                $table->dropColumn(['reject_remark']);
            });
        }
    }
}
